package it.koutifaris.travianmap.model;

import junit.framework.Assert;
import android.test.AndroidTestCase;

/**
 * Tribes DB codes are this: <br/>
 * TID: The tribe number. 1 = Roman, 2 = Teuton, 3 = Gaul, 4 = Nature and 5 = Natars
 * 
 * @author akoutifaris
 * 
 */
public class TribeTest extends AndroidTestCase {

	public void testValueOfForRoman() {
		Assert.assertEquals(Tribe.ROMAN, Tribe.valueOf(1));
	}

	public void testValueOfForTeuton() {
		Assert.assertEquals(Tribe.TEUTON, Tribe.valueOf(2));
	}

	public void testValueOfForGaul() {
		Assert.assertEquals(Tribe.GAUL, Tribe.valueOf(3));
	}

	public void testValueOfForNature() {
		Assert.assertEquals(Tribe.NATURE, Tribe.valueOf(4));
	}

	public void testValueOfForNatars() {
		Assert.assertEquals(Tribe.NATARS, Tribe.valueOf(5));
	}

	public void testValueOfForInvalidPositiveId() {
		try {
			Tribe.valueOf(6);
			Assert.fail("Tribe whith ID 6 does not exist");
		} catch (Exception e) {
		}
	}

	public void testValueOfFor0Id() {
		try {
			Tribe.valueOf(0);
			Assert.fail("Tribe whith ID 0 does not exist");
		} catch (Exception e) {
		}
	}

	public void testValueOfForNegativeId() {
		try {
			Tribe.valueOf(-1);
			Assert.fail("Tribe whith ID -1 does not exist");
		} catch (Exception e) {
		}

	}

}
